package com.ctsi.canal.starter.context;

import com.ctsi.canal.starter.model.CanalModel;

/**
 * canal上下文
 *
 * @author ajh
 * @date 2019/10/24 15:24
 */
public class CanalContext {

    private static final ThreadLocal<CanalModel> THREAD_LOCAL = new ThreadLocal<>();

    public static CanalModel getModel() {
        return THREAD_LOCAL.get();
    }

    public static void setModel(CanalModel canalModel) {
        THREAD_LOCAL.set(canalModel);
    }

    public static void removeModel() {
        THREAD_LOCAL.remove();
    }
}
